//
//  LGReportDetailCT01Cell.m
//  HeartDiseaseManage
//
//  Created by 1234 on 2023/6/8.
//

#import "LGReportDetailCT01Cell.h"

#define lineHeight   viewPix(30)
#define contentWidth     (Screen_W-viewPix(64)-70)
@interface LGReportDetailCT01Cell()
/**   */
@property (nonatomic , strong)UIView *baseView;
/**   */
@property (nonatomic , strong)UIButton *titleBtn;
/**   */
@property (nonatomic , strong)UILabel *pTitle;
/**   */
@property (nonatomic , strong)UILabel *pContent;
/**   */
@property (nonatomic , strong)UILabel *qtTitle;
/**   */
@property (nonatomic , strong)UILabel *qtContent;
/**   */
@property (nonatomic , strong)UILabel *rateTitle;
/**   */
@property (nonatomic , strong)UILabel *rateContent;
/**   */
@property (nonatomic , strong)UILabel *qrsTitle1;
/**   */
@property (nonatomic , strong)UILabel *qrsContent1;
/**   */
@property (nonatomic , strong)UILabel *qrsTitle2;
/**   */
@property (nonatomic , strong)UILabel *qrsContent2;
/**   */
@property (nonatomic , strong)UILabel *rvTitle;
/**   */
@property (nonatomic , strong)UILabel *rvContent;
/**   */
@property (nonatomic , strong)UILabel *prTitle;
/**   */
@property (nonatomic , strong)UILabel *prContent;
/**   */
@property (nonatomic , strong)UILabel *rv5Title;
/**   */
@property (nonatomic , strong)UILabel *rv5Content;

@end

@implementation LGReportDetailCT01Cell

-(instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier{
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        [self createSubView];
    }
    return  self;
}

-(void)setDataDic:(NSDictionary *)dataDic{
    _dataDic = dataDic;
    self.pContent.text = LGNSString(dataDic[@"p_value"]);
    self.qtContent.text = LGNSString(dataDic[@"qt_qtc_value"]);
    self.rateContent.text = LGNSString(dataDic[@"xl_value"]);
    self.qrsContent1.text = LGNSString(dataDic[@"qrs_value"]);
    self.qrsContent2.text = LGNSString(dataDic[@"qrsdz_value"]);
    self.rvContent.text = LGNSString(dataDic[@"rv5_sv1_a_value"]);
    self.prContent.text = LGNSString(dataDic[@"pr_value"]);
    self.rv5Content.text = LGNSString(dataDic[@"rv5_sv1_b_value"]);
}

-(void)createSubView{
    self.backgroundColor = [UIColor clearColor];
    [self.contentView addSubview:self.baseView];
    [self.baseView addSubview:self.titleBtn];
    [self.baseView addSubview:self.pTitle];
    [self.baseView addSubview:self.pContent];
    [self.baseView addSubview:self.qtTitle];
    [self.baseView addSubview:self.qtContent];
    [self.baseView addSubview:self.rateTitle];
    [self.baseView addSubview:self.rateContent];
    [self.baseView addSubview:self.qrsTitle1];
    [self.baseView addSubview:self.qrsContent1];
    [self.baseView addSubview:self.qrsTitle2];
    [self.baseView addSubview:self.qrsContent2];
    [self.baseView addSubview:self.rvTitle];
    [self.baseView addSubview:self.rvContent];
    [self.baseView addSubview:self.prTitle];
    [self.baseView addSubview:self.prContent];
    [self.baseView addSubview:self.rv5Title];
    [self.baseView addSubview:self.rv5Content];
    [self.baseView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.equalTo(self.contentView).offset(viewPix(8));
        make.bottom.equalTo(self.contentView).offset(-viewPix(8));
        make.left.equalTo(self.contentView).offset(viewPix(16));
        make.right.equalTo(self.contentView).offset(-viewPix(16));
        make.height.equalTo(@(viewPix(305)));
    }];
}

-(UIView *)baseView{
    if(!_baseView){
        _baseView = [UIView shadowViewWithColor:@"#B3C5D9" offset:CGSizeMake(0, 2) opacity:0.1 radius:15];
        _baseView.backgroundColor = [UIColor whiteColor];
    }
    return _baseView;
}

-(UIButton *)titleBtn{
    if(!_titleBtn){
        _titleBtn = [UIButton buttonWithTitle:@"报告信息" titleFont:LGFontWeight(16, UIFontWeightMedium) textColor:@"#1F6CC6" imageName:@""];
        [_titleBtn setBackgroundImage:[UIImage imageNamed:@"就诊检查-蓝色"] forState:UIControlStateNormal];
        _titleBtn.frame = CGRectMake(0, viewPix(20), 112, 27);
        _titleBtn.userInteractionEnabled = NO;
    }
    return _titleBtn;
}

-(UILabel *)pTitle{
    if(!_pTitle){
        _pTitle = [UILabel lableWithText:@"P" colorString:@"#666666" textFont:LGFont(13) textAlignment:NSTextAlignmentLeft lines:1];
        _pTitle.frame = CGRectMake(viewPix(16), viewPix(55), 60, lineHeight);
    }
    return _pTitle;
}

-(UILabel *)pContent{
    if(!_pContent){
        _pContent = [UILabel lableWithText:@"" colorString:@"#333333" textFont:LGFontWeight(13, UIFontWeightMedium) textAlignment:NSTextAlignmentRight lines:1];
        _pContent.frame = CGRectMake(viewPix(16)+70, kMinY(self.pTitle.frame), contentWidth, lineHeight);
    }
    return _pContent;
}

-(UILabel *)qtTitle{
    if(!_qtTitle){
        _qtTitle = [UILabel lableWithText:@"Qt/QTc" colorString:@"#666666" textFont:LGFont(13) textAlignment:NSTextAlignmentLeft lines:1];
        _qtTitle.frame = CGRectMake(viewPix(16), kMaxY(self.pTitle.frame), 60, lineHeight);
    }
    return _qtTitle;
}

-(UILabel *)qtContent{
    if(!_qtContent){
        _qtContent = [UILabel lableWithText:@"" colorString:@"#333333" textFont:LGFontWeight(13, UIFontWeightMedium) textAlignment:NSTextAlignmentRight lines:1];
        _qtContent.frame = CGRectMake(viewPix(16)+70, kMinY(self.qtTitle.frame), contentWidth, lineHeight);
    }
    return _qtContent;
}

-(UILabel *)rateTitle{
    if(!_rateTitle){
        _rateTitle = [UILabel lableWithText:@"心率" colorString:@"#666666" textFont:LGFont(13) textAlignment:NSTextAlignmentLeft lines:1];
        _rateTitle.frame = CGRectMake(viewPix(16), kMaxY(self.qtTitle.frame), 60, lineHeight);
    }
    return _rateTitle;
}

-(UILabel *)rateContent{
    if(!_rateContent){
        _rateContent = [UILabel lableWithText:@"" colorString:@"#333333" textFont:LGFontWeight(13, UIFontWeightMedium) textAlignment:NSTextAlignmentRight lines:1];
        _rateContent.frame = CGRectMake(viewPix(16)+70, kMinY(self.rateTitle.frame), contentWidth, lineHeight);
    }
    return _rateContent;
}

-(UILabel *)qrsTitle1{
    if(!_qrsTitle1){
        _qrsTitle1 = [UILabel lableWithText:@"QRS" colorString:@"#666666" textFont:LGFont(13) textAlignment:NSTextAlignmentLeft lines:1];
        _qrsTitle1.frame = CGRectMake(viewPix(16), kMaxY(self.rateTitle.frame), 60, lineHeight);
    }
    return _qrsTitle1;
}

-(UILabel *)qrsContent1{
    if(!_qrsContent1){
        _qrsContent1 = [UILabel lableWithText:@"" colorString:@"#333333" textFont:LGFontWeight(13, UIFontWeightMedium) textAlignment:NSTextAlignmentRight lines:1];
        _qrsContent1.frame = CGRectMake(viewPix(16)+70, kMinY(self.qrsTitle1.frame), contentWidth, lineHeight);
    }
    return _qrsContent1;
}

-(UILabel *)qrsTitle2{
    if(!_qrsTitle2){
        _qrsTitle2 = [UILabel lableWithText:@"QRS电轴" colorString:@"#666666" textFont:LGFont(13) textAlignment:NSTextAlignmentLeft lines:1];
        _qrsTitle2.frame = CGRectMake(viewPix(16), kMaxY(self.qrsTitle1.frame), 60, lineHeight);
    }
    return _qrsTitle2;
}

-(UILabel *)qrsContent2{
    if(!_qrsContent2){
        _qrsContent2 = [UILabel lableWithText:@"" colorString:@"#333333" textFont:LGFontWeight(13, UIFontWeightMedium) textAlignment:NSTextAlignmentRight lines:1];
        _qrsContent2.frame = CGRectMake(viewPix(16)+70, kMinY(self.qrsTitle2.frame), contentWidth, lineHeight);
    }
    return _qrsContent2;
}

-(UILabel *)rvTitle{
    if(!_rvTitle){
        _rvTitle = [UILabel lableWithText:@"Rv+Sv1" colorString:@"#666666" textFont:LGFont(13) textAlignment:NSTextAlignmentLeft lines:1];
        _rvTitle.frame = CGRectMake(viewPix(16), kMaxY(self.qrsTitle2.frame), 60, lineHeight);
    }
    return _rvTitle;
}

-(UILabel *)rvContent{
    if(!_rvContent){
        _rvContent = [UILabel lableWithText:@"" colorString:@"#333333" textFont:LGFontWeight(13, UIFontWeightMedium) textAlignment:NSTextAlignmentRight lines:1];
        _rvContent.frame = CGRectMake(viewPix(16)+70, kMinY(self.rvTitle.frame), contentWidth, lineHeight);
    }
    return _rvContent;
}

-(UILabel *)prTitle{
    if(!_prTitle){
        _prTitle = [UILabel lableWithText:@"P-R" colorString:@"#666666" textFont:LGFont(13) textAlignment:NSTextAlignmentLeft lines:1];
        _prTitle.frame = CGRectMake(viewPix(16), kMaxY(self.rvTitle.frame), 60, lineHeight);
    }
    return _prTitle;
}

-(UILabel *)prContent{
    if(!_prContent){
        _prContent = [UILabel lableWithText:@"" colorString:@"#333333" textFont:LGFontWeight(13, UIFontWeightMedium) textAlignment:NSTextAlignmentRight lines:1];
        _prContent.frame = CGRectMake(viewPix(16)+70, kMinY(self.prTitle.frame), contentWidth, lineHeight);
    }
    return _prContent;
}

-(UILabel *)rv5Title{
    if(!_rv5Title){
        _rv5Title = [UILabel lableWithText:@"Rv5/Sv1" colorString:@"#666666" textFont:LGFont(13) textAlignment:NSTextAlignmentLeft lines:1];
        _rv5Title.frame = CGRectMake(viewPix(16), kMaxY(self.prTitle.frame), 60, lineHeight);
    }
    return _rv5Title;
}

-(UILabel *)rv5Content{
    if(!_rv5Content){
        _rv5Content = [UILabel lableWithText:@"" colorString:@"#333333" textFont:LGFontWeight(13, UIFontWeightMedium) textAlignment:NSTextAlignmentRight lines:1];
        _rv5Content.frame = CGRectMake(viewPix(16)+70, kMinY(self.rv5Title.frame), contentWidth, lineHeight);
    }
    return _rv5Content;
}


- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
